package com.dangz.dans.response;

/**
 * 响应码大类
 */
public enum TypeEnum {
	Success("0", "成功类响应码"), 
	Error("9", "系统错误类响应码");

	private String code;
	private String info;

	private TypeEnum(String code, String info) {
		this.code = code;
		this.info = info;
	}

	public String getCode() {
		return code;
	}

	/**
	 * 获取完整的响应码
	 * 
	 * @param respTypeEnum 响应码大类Enum
	 * @param respApiEnum api接口Enum
	 * @param respCodeEnum	具体错误Enum
	 * @return
	 */
	public static String getFullRespCode(TypeEnum respTypeEnum, ApiEnum respApiEnum, CodeEnum respCodeEnum) {
		StringBuffer sb = new StringBuffer();
		sb.append(respTypeEnum.getCode());
		sb.append(respApiEnum.getCode());
		sb.append(respCodeEnum.getCode());
		return sb.toString();
	}
}
